export const name = 'sdp_template'
export const module = 'sdp_template'
export const title = '模板'

import { ref } from 'vue'
export function init(self) {
  const obj = {
    name,
    module,
    title,
    columns: [
      {
        prop: 'id',
        label: '编号',
        hide: true,
      },
      {
        prop: 'workspace_name',
        label: '工作区',
        sort_by_gbk: true,
      },
      {
        prop: 'project_name',
        label: '项目',
        sort_by_gbk: true,
      },
      {
        prop: 'name',
        label: '名称',
        sort_by_gbk: true,
      },
      {
        prop: 'file_type',
        label: '文件类型',
      },
      {
        prop: 'project',
        label: '工程',
      },
      {
        prop: 'package_name',
        label: '包',
      },
      {
        prop: 'file_template',
        label: '模板',
      },
      {
        prop: 'no_overwrite',
        label: '不覆盖生成',
      },
      {
        prop: 'extra_info',
        label: '附加参数',
      },
      {
        prop: 'remark',
        label: '备注',
        sort_by_gbk: true,
      },
    ],
    editColumns: [
      {
        prop: 'id',
        label: '编号',
        disabled: true,
        hide: true,
      },
      {
        prop: 'workspace_name',
        label: '工作区',
      },
      {
        prop: 'project_name',
        label: '项目',
      },
      {
        prop: 'name',
        label: '名称',
      },
      {
        prop: 'file_type',
        label: '文件类型',
      },
      {
        prop: 'project',
        label: '工程',
      },
      {
        prop: 'package_name',
        label: '包',
      },
      {
        prop: 'file_template',
        label: '模板',
      },
      {
        prop: 'no_overwrite',
        label: '不覆盖生成',
      },
      {
        prop: 'extra_info',
        label: '附加参数',
      },
      {
        prop: 'remark',
        label: '备注',
      },
    ],

    queryColumns: [
    ],

    remoteConfig: {
      count: {module, method: 'count'},
      list: {module, method: 'list'},
      export_excel: {module, method: 'export_excel'},
      edit: {module, method: 'update', keys: [
        'id',
      ]},
      add: {module, method:'add'},
      delete: {module, method: 'delete', keys: [
        'id',
      ]},
    }
  }
  for(let p in obj) {
    self[p] = ref(obj[p])
  }
}
